package main

import (
	"errors"
	"fmt"
)

func main() {

	var err error = fmt.Errorf("%s ", "this is error")

	fmt.Println(err)

	var errors error = errors.New("this is errors !!!")

	fmt.Println(errors)

	v, err := errTest(10, 0)

	if(err == nil){

		fmt.Println("v is " ,v)
	}else{

		fmt.Println(err.Error())
	}
}

func errTest(a, b int) (c int, err error) {

	if (b == 0) {

		return 0, fmt.Errorf("%s", "b Can not be 0 !")
	}

	return a / b, nil

}
